package com.wiloon.java8x.basic.reflect;

import java.lang.reflect.Field;

/**
 * User: Administrator
 * Date: 11/17/13
 * Time: 3:06 PM
 */

public class ReflectTest {
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        Secret s = new Secret("top secret");
        Field f = Secret.class.getDeclaredField("secrecy");
         f.setAccessible(true) ;
         System.out.println(f.get(s));
    }
}

class Secret{
    private String secrecy;
    public Secret(String secrecy){
        this.secrecy= secrecy;
    }

    public String getSecrecy(){
        return null;
    }
}